<template>
  <div class="AppAlert">
    <div class="centen">
      <p>{{title}}</p>
      <div class="body" :style="{ fontSize: postFontSize + 'px' }">
        {{centent}}<slot></slot>
      </div>
      <div class="Button">
        <button @click="shoudao">{{ButText}}</button>
        <button @click="FontSizeBig">内容字体变大</button>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "app-alert",
    data() {
      return {
        text:"收到通知了！",
      }
    },
    props: {
      title: {
        type: String,
        default: '标题'
      },
      centent: {
        type: String,
        default: ''
      },
      ButText: {
        type: String,
        default: '确定'
      },
      postFontSize: {
        type: Number,
        default: 12
      }
    },
    methods: {
      shoudao(){
        this.$emit('textBut',this.text)
      },
      FontSizeBig(){
        this.$emit("FontSizeBig");
      }
    }
  }
</script>

<style scoped lang="scss">
  .AppAlert {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);

    .centen {
      width: 300px;
      height: 250px;
      padding: 10px;
      background: white;
      border-radius: 10px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: center;

      .body {
        flex: 1;
        width: 100%;
        overflow: auto;
        padding: 0 15px;
        box-sizing: border-box;
      }

      .Button{
        width: 100%;
        height: 40px;
        display: flex;
        align-items: center;

        button {
          flex: 1;
          height: 100%;
        }
      }

    }

  }
</style>
